<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>忘记密码</title>
    <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css"/>
    <script src="/jquery/jquery-1.11.2.min.js"></script>
    <script src="/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        function check() {
            var myReg=/^[a-zA-Z0-9_-]+@([a-zA-Z0-9]+\.)+(com|cn|net|org)$/;
            var mail = document.getElementById("firstname");
            if(mail.value === ""){ //输入不能为空
                alert("输入不能为空!");
                return false;
            }else if(!myReg.test(mail.value)){ //正则验证不通过，格式不对
                alert("请输入正确邮箱格式!");
                return false;
            }else{
                return true;
            }
        }
    </script>
</head>
<body>
    <div>
        <form  class="form-horizontal" role="form" method="post" action="/user/forgetpassword">
            <div class="form-group">
                <label for="firstname" class="col-sm-2 control-label">邮箱</label>
                <div class="col-sm-3">
                    <input name="email" type="text" class="form-control" id="firstname" placeholder="输入邮箱地址"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-default" onclick="return check();">提交</button>
                </div>
            </div>
        </form>
    </div>
</body>
</html>